<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/twitter-bootstrap/3.4.1/css/bootstrap.min.css">
    <style>
        .reg{
            width: 400px;
            margin: 0 auto;
        }
    </style>
</head>

<body>
    <div class="reg">
        <h1 style="text-align: center">注册</h1>
        {% for field in form %}
            {% if field.name == 'code' %}
                <div class="form-group">
                    <label>{{ field.label }}</label>
                    <div class="clearfix">
                        <div class="col-md-6" style="padding-left: 0">{{ field }}</div>
                        <div class="col-md-6"><input class="btn btn-default" type="button" value="获取验证码"></div>
                    </div>
                </div>
            {% else %}
                <div class="form-group">
                <label>{{ field.label }}</label>
                {{ field }}
            </div>

            {% endif %}

        {% endfor %}
        <button type="submit" class="btn btn-primary">注册</button>
    </div>
</body>
</html>